<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            margin: 100px auto;
            width: 200px;
            border: 1px solid #000;
            text-align: center;
        }
    </style>
</head>

<body>
    <div class="box">
        <span>英雄名称</span><input class="mc" type="text"><br>
        <span>英雄皮肤</span><input class="pf" type="text"><br>
        <button>提交</button>
    </div>
    <script src="./js/jquery-1.12.4.js"></script>
    <script>
        $('button').on('click', function () {
            if ($('.mc').val().trim().length == 0 || $('.pf').val().trim().length == 0) return
            let cname = $('.mc').val()
            let skin_name = $('.pf').val()
            let obj = { cname, skin_name }
            $.post('http://127.0.0.1:3001/addHeroSkin', obj, function (arr) {
                console.log(arr)
            })
        })
    </script>
</body>

</html>